feat(engine): sequential workflow executor core (closes #22)#56
Merged
Conversation
- Add Executor.Run: sequential steps, interpolate with, workflow Policy checks, tool vs agent dispatch, agent JSON Schema validation - Persist run_steps and trace (step/tool/model events) - timeout.go: agent step timeout from Agent constraints - retries.go: one MVP retry for ErrTransientGeneration model errors - workflow.go: lookup workflow, validate workflow input schema, build output - steps.go: tool and agent step runners (mock model + native tool tests) Closes #22 Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the sequential workflow execution engine from issue #22 and design doc sections 12.2 E, 13.3, 13.4, and 14.2: run workflows step-by-step with interpolation, policy, tools, agents, schema validation, and persistence.
New files (as scoped)
execution.goExecutor,RunInput,Runorchestrationworkflow.gosteps.gotimeout.gocontext.WithTimeoutfromAgent.constraints.timeoutSecondsretries.goErrTransientGenerationBehavior
uses(tool) oragentper step; native/MCP/HTTP/mock tools go throughtools.ToolExecutor; agents usemodels.ModelClient(registry orModelResolvefor tests).InterpolateWalkon each stepswith` map.policy.Engine.Evaluatorfor the workflowsspec.policy` name (budgets, structured output, tools, approvals).withmap.agent.spec.output.schemais set,schema.Validateruns (hard fail on invalid instance).runsrow; updatesrun_steps,FinishRun, optionaltrace.Recorder(step.*,tool.*,model.*).spec.retryinside MCP/HTTP runtimes.Tests
echotool then mock model agent; asserts final runoutput_jsonand trace events.summary; run endsfailed.withAgentRetryinvokes fn twice on transient error.Verification
make fmtmake vetmake test(-race)Follow-ups (out of scope for #22)
agentctl runCLI, parallelism, conditionals, environment policy merge.Closes #22
Made with Cursor